import React, {useState, useReducer} from 'react'
import useLoadData from "../utils/useLoadData"
import useLocalReducer from "../utils/useLocalReducer"


function StateFunction() {

  const [num,setNum] = useLoadData()
  const [state,dispatch] = useLocalReducer()

  return <div onClick={()=>{
    dispatch({
      type: 'age',
      age: '222'
    })
  }}>
    这是一个函数组件-{num},age: {state.age}
  </div>
}

export default StateFunction